<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>菜单信息列表</title>
    <link rel="icon" th:href="@{/favicon.ico}">
    <link rel="shortcut icon" th:href="@{/favicon.ico}">
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <link type="text/css"  th:href="@{/css/index.css}" rel="stylesheet"  />
    <link type="text/css"  th:href="@{/css/jconfirm.css}" rel="stylesheet"  />
    <script th:src="@{/js/jQuery1.7.2.js}" type="text/javascript"></script>
    <script th:src="@{/js/index.js}" type="text/javascript"></script>
    <script th:src="@{/js/menu.js}" type="text/javascript"></script>
    <script th:src="@{/js/jconfirm.js}" type="text/javascript"></script>
</head>
<body>
    <div class="mian_center">
        <span class="main_titile"><img th:src="@{/images/login_j_03.png}">菜单信息列表</span>

        <div class="main_con">
            <form id="searchFr" th:action="@{/menu/list}" method="get">
                <ul>
                    <li><span>菜单名称:</span><input name="menuName" type="text" th:value="*{param.menuName}" placeholder="请输入菜单名称" autocomplete="off" /></li>
                    <li><span>父菜单:</span>
                        <select name="parentName">
                            <option value="">【请选择】</option>
                            <option th:if="${menuParents != null}" th:each="menuParent : ${menuParents}"
                                    th:selected="*{param!=null && #strings.equals(param.parentName,menuParent.menuId)}"
                                    th:value="${menuParent.menuId}">[[${menuParent.menuName}]]</option>
                        </select>
                    </li>
                    <li><span>菜单等级:</span>
                        <select name="mlevel">
                            <option value="">【请选择】</option>
                            <option th:each="num : ${#numbers.sequence(1,2)}"
                                    th:selected="*{param!=null && #strings.equals(param.mlevel,num)}"
                                    th:value="${num}">[[${num}]]</option>
                        </select>
                    </li>
                    <li><span>状态:</span>
                        <select name="flag">
                            <option value="">【请选择】</option>
                            <option th:selected="*{param!=null && #strings.equals(param.flag,'1')}"
                                    th:value="1">已删除</option>
                            <option th:selected="*{param!=null && #strings.equals(param.flag,'0')}"
                                    th:value="0">未删除</option>
                        </select>
                    </li>
                    <li><span class="msg">[[${msg}]]</span></li>
                </ul>
                <span class="main_button">
                    <input  id="pSize"  name="pSize" type="hidden" th:value="*{param.pSize}" />
                    <input  id="currentPn"  name="pn" type="hidden" th:value="*{param.pn}" />
                    <input type="submit" value="查询" />
                </span>
            </form>
            <table>
                <tr>
                    <th width="30"><input type="checkbox" id="selectAll"></th>
                    <th width="50">序号</th>
                    <th>菜单名称</th>
                    <th>菜单URL</th>
                    <th>菜单权限码</th>
                    <th>父菜单</th>
                    <th>菜单等级</th>
                    <th>创建时间</th>
                    <th>修改时间</th>
                    <th>操作</th>
                </tr>

                <tr th:each="menu : ${menus}">
                    <td><input type="checkbox" class="selectItem" th:value="${menu.menuId}"></td>
                    <td>[[${menu.menuId }]]</td>
                    <td>[[${menu.menuName }]]</td>
                    <td>[[${menu.url==null?'--':menu.url }]]</td>
                    <td>[[${menu.code==null?'--':menu.code }]]</td>
                    <td>[[${menu.parentName==null?'--':menu.parentName }]]</td>
                    <td>[[${menu.mlevel }]]</td>
                    <td>[[${menu.createTime==null?'--':#dates.format(menu.createTime,'YYYY/MM/dd HH:mm:ss')}]]</td>
                    <td>[[${menu.updateTime==null?'--':#dates.format(menu.updateTime,'YYYY/MM/dd HH:mm:ss')}]]</td>
                    <td>
                        <a class="btn mr5" th:href="${'javascript: editMenu('+menu.menuId+');'}" title="修改">修改</a>
                        <a th:if="${#strings.equals(menu.flag,'0')}" class="btn" th:href="${'javascript: remove('+menu.menuId+');'}" title="删除">删除</a>
                        <a th:if="${#strings.equals(menu.flag,'1')}" class="btn" th:href="${'javascript: recover('+menu.menuId+');'}" title="恢复">恢复</a>
                    </td>
                </tr>
                <tr th:if="${#lists.isEmpty(menus)}">
                    <td colspan="10">暂无任何记录</td>
                </tr>
            </table>
        </div>

        <div class="main_page_number"
             th:unless="${#lists.isEmpty(menus)}" th:include="/common/page :: page">
        </div>
    </div>
</body>
</html>